//
//  TJQuestionController.m
//  Teleport
//
//  Created by botu　 on 2020/8/11.
//  Copyright © 2020 byx. All rights reserved.
//

#import "TJQuestionController.h"
#import "TJQuestionDetailController.h"

@interface TJQuestionController ()
@property (strong, nonatomic) NSArray *datas;
@end

@implementation TJQuestionController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationBar.title = @"常见问题".localizedString;
     self.tableView.showsVerticalScrollIndicator = NO;
     self.tableView.rowHeight = 48;
     self.tableView.backgroundColor = UIColor.whiteColor;
     self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
     self.tableView.showsHorizontalScrollIndicator = NO;
     self.tableView.showsVerticalScrollIndicator = NO;
      [self.tableView registerClass:TJStyle1Cell.self forCellReuseIdentifier:style1Cell];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.bottom.offset(0);
          make.top.offset(80);
     }];
     
    self.datas = @[@"银行卡被冻结怎么办?",@"卖币时显示对方已支付未收到付款怎么办?",@"如何申请成为商家?"];
    
    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.datas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TJStyle1Cell *cell = [tableView dequeueReusableCellWithIdentifier:style1Cell forIndexPath:indexPath];
  
    cell.tj_textLabel.text = self.datas[indexPath.row];
    cell.tj_textLabel.textColor =UIColor.tj_mainColor;
    cell.tj_textLabel.font = UIFont_Px(15);

    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    TJQuestionDetailController *detailVC  = [TJQuestionDetailController new];
    detailVC.type = indexPath.row;
    detailVC.navigationBar.title = @"常见问题解答".localizedString;
    
    [self.navigationController pushViewController:detailVC animated:YES];
}


@end
